﻿using System;
using System.Collections.Generic;

using BizElements.Core;

namespace BizElements.BusinessLayer
{
    /// <summary>Contains information about business object structure and security, ie. acces permissions, and provides generic interface for children management.</summary>
    public interface IBusinessObjectDescriptor : IDataObjectDescriptor
    {
        /// <summary>Definitions/IDs of commonly used entity functions/permissions such as: read, write, assignment, UI functions.</summary>
        EntityPermissionSet Permissions { get; }

        /// <summary>Children collection properties owned by entity. Empty collection if class doesn't contain child entity collections.</summary>
        IEnumerable<IChildrenAdapter> Children { get; }
        
        /// <summary>Complex property adapters and meta owned by entity. Empty collection if class doesn't contain complex properties.</summary>
        IEnumerable<IComplexPropertyAdapter> ComplexProperties { get; }

        /// <summary>Optional lock mode for pessimistic offline locking control scheme.</summary>
        LockMode? PessimisticLockMode { get; }
    }
}